package pers.fulsun.demo.springcloud.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author fulsun
 * @since 2021-08-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
@ApiModel(value = "User", description = "用户实体")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id", dataType = "Integer", name = "id", required = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value = "用户姓名", dataType = "String ", name = "name", required = true)
    @TableField("name")
    private String name;


    /**
     * 用户年龄
     */
    @ApiModelProperty(value = "用户年龄", dataType = "Integer ", name = "age", required = true)
    @TableField("age")
    private Integer age;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人", dataType = "String ", name = "createBy", required = true)
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", dataType = "LocalDateTime ", name = "createTime", required = true)
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    private LocalDateTime createDate;

    /**
     * 最后更新人
     */
    @ApiModelProperty(value = "最后更新人", dataType = "String ", name = "updateBy", required = true)
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /**
     * 最后更新时间
     */
    @ApiModelProperty(value = "最后更新时间", dataType = "LocalDateTime ", name = "updateTime", required = true)
    @TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateDate;

    /**
     * 逻辑删除标志
     */
    @TableLogic
    @ApiModelProperty(value = "逻辑删除标志", dataType = "Byte", name = "isDelete", required = false)
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    private byte isDelete;
}